package server.models.cabane;

import java.io.Serializable;
import java.rmi.RemoteException;
import java.util.Observable;

import rmi.RemoteObservable;
import rmi.RemoteObserver;
import rmi.WrappedObserver;
import server.models.plateau.Plateau;


public class Cabane extends Observable implements ICabane, Serializable {
	
	private static final long serialVersionUID = 1L;

	private String nomCabane = null;
	
	private Plateau plateau;
	
	public Cabane(String nom) {
		this.nomCabane = nom;
	}
	
	public Plateau getPlateau() {
		return plateau;
	}

	public void lancerPlateau() {
		this.plateau = new Plateau();
		this.setChanged();
		this.notifyObservers();
	}

	@Override
	public void addObserver(RemoteObserver remoteObserver)
			throws RemoteException {
		this.addObserver(new WrappedObserver(remoteObserver));
		
	}

	public String getNomCabane() {
		return nomCabane;
	}
}
